getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sat, 14 May 2022 18:35:44 +0000 (19:35 +0100)
committerRyan Tandy <ryan@nardis.ca>
Sat, 14 May 2022 18:35:44 +0000 (19:35 +0100)
commita15ce2d25df75fa1e0f82f51713ba322e53a1ad8
treeaffcda2d0a30ae41e390039c37826625f0e03f97
parent8acf7af5a9a34f6ad087583b343ddcc62a44814a
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c